package cycle

import java.lang.Object
/**
 * 循环
 *  while
 *  for
 *  for in   语句也可用于循环访问Map
 *  循环控制
 *   break
 *   continue
 */
class Cycle {

    public static void main(String[] args) {
        def  kj  = 99;
        println "kj = $kj"

//        while(true){
//            println "demo";
//        }
        for (def i =0;i<10;i++){
            println i
        }
        //语句也可用于循环访问数组
        def array =["12","s","33"]
        for (Object o in array){
            println  o
        }

        //语句也可用于循环访问Map
        def employee = ["Ken" : 21, "John" : 25, "Sally" : 22];
        for(emp in employee) {
            println(emp);
        }
    }
}
